package tech.dort.dortware.impl.modules.exploit;

import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.multiplayer.GuiConnecting;
import tech.dort.dortware.api.module.Module;
import tech.dort.dortware.api.module.ModuleData;

public class LunarClientSpoofer extends Module {

    public LunarClientSpoofer(ModuleData moduleData) {
        super(moduleData);
    }

    @Override
    public void onEnable() {
        if (mc.isSingleplayer()) {
            return;
        }

        mc.theWorld.sendQuittingDisconnectingPacket();
        mc.loadWorld(null);
        mc.displayGuiScreen(new GuiMainMenu());
        try {
            Thread.sleep(2000);
        } catch (Exception e) {
            e.printStackTrace();
        }
        mc.displayGuiScreen(new GuiConnecting(new GuiMultiplayer(null), mc, GuiConnecting.lastIP));
        super.onEnable();
    }
}